package net.risesoft.y9.pubsub.message;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonTypeInfo;

/**
 * 任务消息
 * 
 * @author dingzhaojun
 * @author qinman
 * @author mengjuhua
 * @date 2022/2/10
 */
public class Y9MessageTask implements Serializable {

    private static final long serialVersionUID = -4044715647192713249L;

    // 解决 jackson 序列化丢失类型
    @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
    private Serializable taskObj;
    private String eventType;
    private String eventTarget;
    private String tenantId;

    private String personId;

    public Y9MessageTask() {}

    public Y9MessageTask(Serializable taskObj, String eventType, String eventTarget, String tenantId, String personId) {
        super();
        this.taskObj = taskObj;
        this.eventType = eventType;
        this.eventTarget = eventTarget;
        this.tenantId = tenantId;
        this.personId = personId;
    }

    public String getEventTarget() {
        return eventTarget;
    }

    public String getEventType() {
        return eventType;
    }

    public String getPersonId() {
        return personId;
    }

    public Serializable getTaskObj() {
        return taskObj;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setEventTarget(String eventTarget) {
        this.eventTarget = eventTarget;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public void setPersonId(String personId) {
        this.personId = personId;
    }

    public void setTaskObj(Serializable taskObj) {
        this.taskObj = taskObj;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    @Override
    public String toString() {
        return "Y9MessageTask [taskObj=" + taskObj + ", eventType=" + eventType + ", eventTarget=" + eventTarget + ", tenantId=" + tenantId + ", personId=" + personId + "]";
    }
}